package org.ecbox.sdk.dict;

/**
 * 会员关心的销售订单状态，不同于订单本身的状态
 * 
 * File: MemberOrderStatus.java<br/>
 * Description: <br/>
 *
 * Copyright: Copyright (c) 2014 ecbox.com<br/>
 * Company: ECBOX,Inc.<br/>
 *
 * @author wangsheng
 * @date 2014年4月27日
 * @version 1.0
 */
public enum SaleStatus {

	UNRECEIPT("UNRECEIPT","待收货"),	//待收货
	NOPAY("NOPAY","未付款"),	//待付款的情况：货到付款还未发货的话，订单不计入待付款的情况
	
  FINISH("FINISH","交易完成"), //交易完成，已退货，已退款都算作交易完成
  CLOSE("CLOSE","交易失败");//退款退货，取消订单，都属于交易关闭

	private String code;
	
  private String name;

  private SaleStatus(String code,String name) {
  	this.code = code;
    this.name = name;
  }

  public static SaleStatus getType(String code) {
    for (SaleStatus type : SaleStatus.values()) {
      if (type.getCode().equals(code)) {
        return type;
      }
    }
    return null;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

}
